package com.example.xposed_apk.Utils;


import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class GetPackName {
    /**
     * 获取当前被加载应用的包名
     * @param lpparam LSPosed 回调中传入的 LoadPackageParam
     * @return 应用包名
     */
    public static String getLoadedPackageName(XC_LoadPackage.LoadPackageParam lpparam) {
        return lpparam.packageName;
    }

    /**
     * 判断是否为主进程（避免多进程应用重复处理）
     * @param lpparam 回调参数
     * @return 若 processName 与 packageName 相同则为主进程
     */
    public static boolean isMainProcess(XC_LoadPackage.LoadPackageParam lpparam) {
        return lpparam.packageName.equals(lpparam.processName);
    }
}
